run a script from command-line using Rscript. Create a custom build system for Sublime Text (Tools > Build System > New Build System). { "cmd": ["Rscript", "$file"] "selector": "source.r", "working_dir": "${project_path:${folder}}", } Now, you can build your R script by pressing F7 or from Tools > Build. Running R scripts from Sublime Text Build System functions. Go to Tools -> Build System -> New Build System { “shell_cmd”: “R –no-save –slave < $file" } Save it as something like “Run-R”, and it will appear in your Build System menu. Select it, and then you can run your script simply by pressing F7.